home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 17.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-09-10  |  9.0 KB  |  366 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11.  
  12. parse arg Num Frames
  13. options results
  14. address "IMAGEFX.1"
  15. Quotes = '22'X
  16.     ReDraw On
  17.     RequestResponse "Do You Need Instructions?"
  18.     if rc = 0 then do
  19.         call Docs()
  20.         end    
  21. if exists("libs:flyer.library") then do
  22.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  23.         RequestNotify 'Flyer Must Be Running First!'
  24.         exit
  25.         end
  26.     call OpenFlyStuff()
  27.  
  28.  
  29.     Gadget.1 = 'D/135/22/120/Main Image Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  30.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 280 60
  31.     if rc ~= 0 then do
  32.         call CloseStuff()
  33.         exit 0
  34.         end
  35.     else do
  36.         IAType = RESULT.1
  37.            end
  38.  
  39.     call GetA()
  40.  
  41.  
  42.     Gadget.1 = 'D/110/22/120/Border Type/5/COLOR/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  43.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  44.     if rc ~= 0 then do
  45.         call CloseStuff()
  46.         exit 0
  47.         end
  48.     else do
  49.         IBType = RESULT.1 -1
  50.         if IBType = -1 then IBType = 4
  51.            end
  52.     call GetB()
  53. end
  54. else do
  55.     Gadget.1 = 'D/135/22/120/Main Image Type/2/FRAME/SEQUENCE'
  56.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 280 60
  57.     if rc ~= 0 then do
  58.         call CloseStuff()
  59.         exit 0
  60.         end
  61.     else do
  62.         IAType = RESULT.1+2
  63.            end
  64.  
  65.     call GetA()
  66.  
  67.     Gadget.1 = 'D/110/22/120/Border Type/3/COLOR/FRAME/SEQUENCE'
  68.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  69.     if rc ~= 0 then do
  70.         call CloseStuff()
  71.         exit 0
  72.         end
  73.     else do
  74.         IBType = RESULT.1+1
  75.         if IBType = 1 then IBType = 4
  76.            end
  77.  
  78.     call GetB()
  79. end
  80.  
  81.     KillBrush
  82.     i = Start
  83.  
  84.     ReDraw On
  85.     LoadBuffer "VFXIFX:Images/Pics/BGFrames.Pic" Force
  86.     RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  87.  
  88.     RequestFile '"Select File To Use For BG Overlay!" "VFXIFX:Images/BGFrames" ""'
  89.     BGName = result
  90.  
  91.  
  92. if FlyOn = 1 then
  93.     call CloseStuff()
  94.  
  95. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  96. call writeln TempFile,PicAName
  97. call writeln TempFile,Start
  98. call writeln TempFile,End
  99. call writeln TempFile,IAType
  100. call writeln TempFile,PicBName
  101. call writeln TempFile,StartB
  102. call writeln TempFile,EndB
  103. call writeln TempFile,IBType
  104. call writeln TempFile,BGName
  105. call close TempFile
  106. exit
  107.  
  108.  
  109.  
  110. Docs:
  111.     text1 = '"This effect uses a special template thats made"'
  112.     text2 = '"out of an image that uses both Blue & Green. It"'
  113.     text3 = '"uses the Cinematte Hook to replace both colors"'
  114.     text4 = '"with 2 other images. The Green is used for the"'
  115.     text5 = '"border and is replaced first. The Blue part is"'
  116.     text6 = '"used to place the Main image on the screen."'
  117.     text7 = '" "'
  118.     text8 = '"Note, that if your first image has blue in it,"'
  119.     text9 = '"that will also be replaced on the second pass."'
  120.     text10 = '"This may or may not give the results you want."'
  121.     text11 = '"For example, if you replace the Green with White,"'
  122.     text12 = '"then all happens as expected. However if you were"'
  123.     text13 = '"to replace it with Purple, then on the next pass"'
  124.     text14 = '"the blue would turn the purple to a transparent"'
  125.     text15 = '"red. Experiment to see what you like best."'
  126.  
  127.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  128.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  129.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  130.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  131.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  132.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  133.     Gadget.7  = 'TEXT LE=10 TE=64 LB='text7' '
  134.     Gadget.8  = 'TEXT LE=10 TE=74 LB='text8' '
  135.     Gadget.9  = 'TEXT LE=10 TE=84 LB='text9' '
  136.     Gadget.10  = 'TEXT LE=10 TE=94 LB='text10' '
  137.     Gadget.11  = 'TEXT LE=10 TE=104 LB='text11' '
  138.     Gadget.12  = 'TEXT LE=10 TE=114 LB='text12' '
  139.     Gadget.13  = 'TEXT LE=10 TE=124 LB='text13' '
  140.     Gadget.14  = 'TEXT LE=10 TE=134 LB='text14' '
  141.     Gadget.15  = 'TEXT LE=10 TE=144 LB='text15' '
  142.     Gadget.16= 'END'
  143.     NewComplexRequest  '"Instructions For Effect #17"' Gadget 366 156
  144. return
  145.  
  146.  
  147. GetFile:
  148.     parse Arg Title, Path
  149.     Address FLY_1 SetString Path
  150.     Address FLY_1 GetFileNameNT Title
  151. return result
  152.  
  153. GetFileName: procedure  
  154.    ARG CompleteName
  155.    c = lastpos("/",CompleteName)
  156.    if c = 0 then c = lastpos(":",CompleteName)
  157.    return substr(CompleteName, c + 1)
  158.  
  159.  
  160. GetA:
  161.  if IAType = 0 then do
  162.     call Switcher(TOSW)
  163.     PicAName = GetFile("Select Flyer Clip For Main Image!  ",DriveName)
  164.     Name = GetFileName(PicAName)
  165.     if Name = "" then do
  166.         Address FLY_1 OK_TEXT " OK "
  167.         Title = "You Must Enter A Valid Clip Name To Use!"
  168.         Address FLY_1 FYINT Title
  169.         Address FLY_1 Quit
  170.         call Switcher(TOWB)
  171.         exit
  172.         end
  173.     Address FLY_1 SetFileName PicAName
  174.     Address FLY_1 GetClipLength PicAName
  175.     End = result
  176.     Start = 0
  177.     Address FLY_1 Program "5"
  178.     Address FLY_1 StartNum Start
  179.     Address FLY_1 EndNum End
  180.     Address FLY_1 CurrentNum "0"
  181.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  182.     Start = word(result,1)*2
  183.     End = word(result,2)*2
  184.     Start  = Start + 1
  185.     End = End +2
  186.     call addlib('PROJECT_REXX_PORT' , 0)
  187.     call addlib(TOASTERLIB,0)
  188.     call Switcher(TOWB)
  189.     address command "C:Wait 1"
  190.     ScreenToFront
  191.     end
  192.    if IAType = 1 then do
  193.     RequestFile '"Select Flyer Still For Main Image!"' DriveName ' '
  194.     PicAName = result
  195.     Name = GetFileName(PicAName)
  196.     if Name = "" then do
  197.         Title = "You Must Enter A Valid Name To Use!"
  198.         RequestNotify Title
  199.         if FlyOn = 1 then Address FLY_1 Quit
  200.         exit
  201.         end
  202.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  203.     End = result
  204.     Start = 1
  205.     end
  206.    if IAType = 2 then do
  207.     RequestFile '"Select FileName For Main Image!"' 'SYS:' ' '
  208.     PicAName = result
  209.     Name = GetFileName(PicAName)
  210.     if Name = "" then do
  211.         Title = "You Must Enter A Valid Name To Use!"
  212.         RequestNotify Title
  213.         if FlyOn = 1 then Address FLY_1 Quit
  214.         exit
  215.         end
  216.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  217.     End = result
  218.     Start = 1
  219.     end
  220.    if IAType = 3 then do
  221.     RequestFile '"Select BaseName For Main Image! "' 'SYS:' ' '
  222.     PicAName = result
  223.     Name = GetFileName(PicAName)
  224.     if Name = "" then do
  225.         Title = "You Must Enter A Valid Name To Use!"
  226.         RequestNotify Title
  227.         if FlyOn = 1 then Address FLY_1 Quit
  228.         exit
  229.         end
  230.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  231.     End = result
  232.     Start = 1
  233.     end
  234.     DriveName = GetPathName(PicAName)
  235.  
  236. return
  237.  
  238.  
  239. GetB:
  240.  if IBType = 0 then do
  241.     call Switcher(TOSW)
  242.     PicBName = GetFile("Select Flyer Clip For Border Image!  ",DriveName)
  243.     Name = GetFileName(PicBName)
  244.     if Name = "" then do
  245.         Address FLY_1 OK_TEXT " OK "
  246.         Title = "You Must Enter A Valid Clip Name To Use!"
  247.         Address FLY_1 FYINT Title
  248.         Address FLY_1 Quit
  249.         call Switcher(TOWB)
  250.         exit
  251.         end
  252.     Address FLY_1 SetFileName PicBName
  253.     Address FLY_1 GetClipLength PicBName
  254.     EndB = result
  255.     StartB = 0
  256.     Address FLY_1 Program "5"
  257.     Address FLY_1 StartNum StartB
  258.     Address FLY_1 EndNum EndB
  259.     Address FLY_1 CurrentNum "-1"
  260.     Address FLY_1 GetTimeNT "Select Frame To Start With For Border Image!"
  261.     StartB = word(result,1)*2
  262.     EndB = word(result,2)*2
  263.     StartB  = StartB + 1
  264.     EndB = EndB +2
  265.     call addlib('PROJECT_REXX_PORT' , 0)
  266.     call addlib(TOASTERLIB,0)
  267.     call Switcher(TOWB)
  268.     address command "C:Wait 1"
  269.     ScreenToFront
  270.     end
  271.    if IBType = 1 then do
  272.     RequestFile '"Select Flyer Still For Border Image!"' DriveName ' '
  273.     PicBName = result
  274.     Name = GetFileName(PicBName)
  275.     if Name = "" then do
  276.         Title = "You Must Enter A Valid Name To Use!"
  277.         RequestNotify Title
  278.         if FlyOn = 1 then Address FLY_1 Quit
  279.         exit
  280.         end
  281.     EndB = Frames
  282.     StartB = 1
  283.     end
  284.    if IBType = 2 then do
  285.     RequestFile '"Select FileName For Border Image!"' 'SYS:' ' '
  286.     PicBName = result
  287.     Name = GetFileName(PicBName)
  288.     if Name = "" then do
  289.         Title = "You Must Enter A Valid Name To Use!"
  290.         RequestNotify Title
  291.         if FlyOn = 1 then Address FLY_1 Quit
  292.         exit
  293.         end
  294.     EndB = Frames
  295.     StartB = 1
  296.     end
  297.    if IBType = 3 then do
  298.     RequestFile '"Select BaseName For Border Image! "' 'SYS:' ' '
  299.     PicBName = result
  300.     Name = GetFileName(PicBName)
  301.     if Name = "" then do
  302.         Title = "You Must Enter A Valid Name To Use!"
  303.         RequestNotify Title
  304.         if FlyOn = 1 then Address FLY_1 Quit
  305.         exit
  306.         end
  307.     EndB = Frames
  308.     StartB = 1
  309.     end
  310.  
  311.    if IBType = 4 then do
  312.     ActiveColor 1
  313.     RequestNotify "Click On Color To Use For Border Then Click "Quotes"Okay"Quotes""
  314.     ActiveColor
  315.     PicBName = result
  316.     ActiveColor 1
  317.     EndB = Frames
  318.     StartB = 1
  319.     end
  320. return
  321.  
  322.  
  323. CloseStuff:
  324.     Address FLY_1 Quit
  325.     call remlib('ToasterARexx.port')
  326.     call remlib('PROJECT_REXX_PORT')
  327. return
  328.  
  329.  
  330. OpenFlyStuff:
  331.     FlyOn = 1
  332.     address command "run VFXIFX:FLY" 
  333.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  334.         address command "wait 1"
  335.         end
  336.     TOASTERLIB="ToasterARexx.port"
  337.     call remlib('ToasterARexx.port')
  338.     call remlib('PROJECT_REXX_PORT')
  339.     call addlib('PROJECT_REXX_PORT' , 0)
  340.     call addlib(TOASTERLIB,0)
  341.     DriveName = FindDrive()
  342. return
  343.  
  344.  
  345. FindDrive:
  346.     address command "C:Info >RAM:DriveList"
  347.     call open TempFile,"RAM:DriveList",R
  348.     do until eof(TempFile)
  349.         line = readln(TempFile)
  350.         parse var line Drive" "Rest
  351.         if Drive = "FA0:" then 
  352.             FlyVolume = word(Rest,7)":"
  353.     end
  354.     call close TempFile
  355.     address command "Delete >NIL: RAM:DriveList"
  356. return FlyVolume
  357.  
  358. GetPathName: procedure  
  359.    parse ARG CompleteName
  360.    c = lastpos("/",CompleteName)
  361.    if c = 0 then c = lastpos(":",CompleteName)
  362.    return left(CompleteName,c)
  363.  
  364.  
  365.  
  366.